package com.wxy.config;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.servlet.ModelAndView;

import lombok.extern.slf4j.Slf4j;

@ControllerAdvice
@Slf4j
public class ExceptionHandle {
	@ExceptionHandler(Exception.class)
	public ModelAndView handler(Exception exception) {
		log.info(exception.getMessage());
		ModelAndView modelAndView=new ModelAndView();
		modelAndView.setViewName("/html/error.html");
		return modelAndView;
	}
}
